﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace LiveResults
{
    public partial class FrmStatusWin : Form
    {
        public FrmStatusWin()
        {
            InitializeComponent();
        }

        public void logit(string msg)
        {
            if (!listBox1.IsDisposed)
            {
                if (listBox1.InvokeRequired)
                {
                    listBox1.Invoke(new MethodInvoker(delegate
                        {
                            logit(msg);
                        }));
                }
                else
                {
                    listBox1.Items.Insert(0, msg);
                }
            }
        }

        private void FrmStatusWin_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                this.Visible = false;
                e.Cancel = true;
            }
        }
    }
}
